﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/head.jspf"%>
<head> 
<title>东方易云后台管理系统</title>
<style>
body { background: #f5f5f5 ;}
</style>
<link rel="stylesheet" href="resource/css/jquery-ui.css" type="text/css"  />
<script type="text/javascript" src="resource/js/jquery-ui.js"></script>
<script>
function editPassChannel(){
	var errorMsg = "";
	errorMsg += sl_checkInteger($("#fiSysSendId")[0], "发送通道编号", 18, 1);
	errorMsg += sl_checkInteger($("#fiSysReceiveId")[0], "接收通道编号", 18, 1);
	var sysRcvIdMsg = $("#sysRcvIdMsg").val();
	if(!isNull(sysRcvIdMsg)){
		alert('<spring:message code="message.norcvdata"/>');
		return;
	}
	var sysSndIdMsg = $("#sysSndIdMsg").val();
	if(!isNull(sysSndIdMsg)){
		alert('<spring:message code="message.nosnddata"/>');
		return;
	}
	if(errorMsg != ""){
		alert(errorMsg);
	}else{
		$('#editForm').submit();
	}
}
function renderRcvData(v){
	var dataxChannelBean = getDataByAjax("services/channel/getReceiveChannel",{fiId:v});
	if(dataxChannelBean!=null){
		$("#fcCommunTypeRcv").html(dataxChannelBean.communType);
		$("#fcCommunParamRcv").html(dataxChannelBean.communParam);
		$("#fcMsgFormateIdRcv").html(dataxChannelBean.msgFormate);
		$("#fcMsgCharsetRcv").html(dataxChannelBean.msgCharset);
		$("#fcMsgTypeRcv").html(dataxChannelBean.msgType);
	}else{
		alert('<spring:message code="message.norcvdata"/>');
		$("#fcCommunTypeRcv").html('');
		$("#fcCommunParamRcv").html('');
		$("#fcMsgFormateIdRcv").html('');
		$("#fcMsgCharsetRcv").html('');
		$("#fcMsgTypeRcv").html('');
		$("#fiSysReceiveId").val('');
	}
}
function renderSndData(v){
	var dataxChannelBean = getDataByAjax("services/channel/getSendChannel",{fiId:v});
	if(dataxChannelBean!=null){
		$("#fcCommunTypeSnd").html(dataxChannelBean.communType);
		$("#fcCommunParamSnd").html(dataxChannelBean.communParam);
		$("#fcMsgFormateIdSnd").html(dataxChannelBean.msgFormate);
		$("#fcMsgCharsetSnd").html(dataxChannelBean.msgCharset);
		$("#fcMsgTypeSnd").html(dataxChannelBean.msgType);
	}else{
		alert('<spring:message code="message.nosnddata"/>');
		$("#fcCommunTypeSnd").html('');
		$("#fcCommunParamSnd").html('');
		$("#fcMsgFormateIdSnd").html('');
		$("#fcMsgCharsetSnd").html('');
		$("#fcMsgTypeSnd").html('');
		$("#fiSysSendId").val('');
	}
}

$(document).ready(function(){
	$("#fiSysSendId").autocomplete({source:"services/channel/getMapSendChannel?fiSysSendId="+encodeURIComponent($(this).val()),
		select: function(e,ui){
			renderSndData(ui.item.value);
		},
		open:function(e,ui){
			$(this).unbind("blur");
		},
		close:function(e,ui){
			$(this).blur(sendBlur);
		}
	});
	
	$("#fiSysReceiveId").autocomplete({source:"services/channel/getMapReceiveChannel?fcChannelDesc="+encodeURIComponent($(this).val()),
		select: function(e,ui){
			renderRcvData(ui.item.value);
		},
		open:function(e,ui){
			$(this).unbind("blur");
		},
		close:function(e,ui){
			$(this).blur(receiveBlur);
		}
	});
	$("#fiSysSendId").blur(sendBlur);
  	$("#fiSysReceiveId").blur(receiveBlur);
});

function sendBlur(){
	var fiSysSend=$("#fiSysSendId").val();
		if(fiSysSend.length>0){
			renderSndData(fiSysSend);
		}else{
			$("#fcCommunTypeSnd").html('');
			$("#fcCommunParamSnd").html('');
			$("#fcMsgFormateIdSnd").html('');
			$("#fcMsgCharsetSnd").html('');
			$("#fcMsgTypeSnd").html('');
			$("#fiSysSendId").val('');
		}
}

function receiveBlur(){
	var fiSysSend=$("#fiSysReceiveId").val();
		if(fiSysSend.length>0){
			renderRcvData(fiSysSend);
		}else{
			$("#fcCommunTypeRcv").html('');
			$("#fcCommunParamRcv").html('');
			$("#fcMsgFormateIdRcv").html('');
			$("#fcMsgCharsetRcv").html('');
			$("#fcMsgTypeRcv").html('');
			$("#fiSysReceiveId").val('');
		}
}

</script>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="js/pngfix.js"></script>
<![endif]-->
</head>
<body>
<form:form action="passChannelEditSubmit" commandName="dataxEnterpriseChannelVO" id="editForm">


<input type="hidden" id="pageNoEnterprise" name="pageNoEnterprise" value="<c:out value='${pageNoEnterprise}'/>" />
<input type="hidden" id="pageNoChannel" name="pageNoChannel" value="<c:out value='${pageNoChannel}'/>" />
<input type="hidden" name="ecCodeSelect" value="<c:out value='${ecCodeSelect }' />"/>
<input type="hidden" name="ecNameSelect" value="<c:out value='${ecNameSelect }' />"/>
<input type="hidden" name="fcEntcode" id="fcEntcode" value="<c:out value='${fcEntcode}' />"/>

<input type="hidden" name="communTypeRcv" id="communTypeRcv" value="<c:out value='${communTypeRcv}' />"/>
<input type="hidden" name="communParamRcv" id="communParamRcv" value="<c:out value='${communParamRcv}' />"/>
<input type="hidden" name="msgFormateIdRcv" id="msgFormateIdRcv" value="<c:out value='${msgFormateIdRcv}' />"/>
<input type="hidden" name="msgCharsetRcv" id="msgCharsetRcv" value="<c:out value='${msgCharsetRcv}' />"/>
<input type="hidden" name="msgTypeRcv" id="msgTypeRcv" value="<c:out value='${msgTypeRcv}' />"/>
<input type="hidden" name="sysRcvIdMsg" id="sysRcvIdMsg" value="<c:out value='${sysRcvIdMsg}' />"/>

<input type="hidden" name="communParamSnd" id="communParamSnd" value="<c:out value='${communParamSnd}' />"/>
<input type="hidden" name="communTypeSnd" id="communTypeSnd" value="<c:out value='${communTypeSnd}' />"/>
<input type="hidden" name="msgFormateIdSnd" id="msgFormateIdSnd" value="<c:out value='${msgFormateIdSnd}' />"/>
<input type="hidden" name="msgCharsetSnd" id="msgCharsetSnd" value="<c:out value='${msgCharsetSnd}' />"/>
<input type="hidden" name="msgTypeSnd" id="msgTypeSnd" value="<c:out value='${msgTypeSnd}' />"/>
<input type="hidden" name="sysSndIdMsg" id="sysSndIdMsg" value="<c:out value='${sysSndIdMsg}' />"/>
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    <!-- Page Head -->
    <div id="page-title">
    <h3>修改企业传输方式</h3></div>
    <div class="pgline"></div>
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>企业信息</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab">
          <table>
            <thead>
              <tr>
                <th>企业编号</th>
                <th>企业名称</th>
                <th>机构代码</th>
                <th>城市</th>
                <th>负责人</th>
                <th>负责人电话</th>
                <th>负责人邮箱</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="7">
                 </td>
              </tr>
            </tfoot>
            <tbody>
              <tr>
                <td><c:out value="${vwDataxEnterpriseVO.ecCode}"></c:out></td>
                <td><c:out value="${vwDataxEnterpriseVO.ecName}"></c:out></td>
                <td><c:out value="${vwDataxEnterpriseVO.orgCode}"></c:out></td>
                <td><c:out value="${vwDataxEnterpriseVO.city}"></c:out></td>
                <td><c:out value="${vwDataxEnterpriseVO.name}"></c:out></td>
                <td><c:out value="${vwDataxEnterpriseVO.officePhone}"></c:out></td>
                <td><c:out value="${vwDataxEnterpriseVO.email}"></c:out></td>
              </tr>
            </tbody>
          </table>
        </div>
        <!-- End #tab1 -->
      </div>
      <!-- End .content-box-content -->
    </div>

    <div style=" border:1px solid #ccc; width:100%; margin:0 0 10px 0;  background-color:#eee">
      <table width="100%" border="1" align="center" cellpadding="1" cellspacing="1">
          <tr>
            <td height="55">&nbsp;&nbsp;&nbsp;&nbsp;服务编码：
              <select class="select1" disabled="disabled">
              	<c:forEach items="${optionServeTypeMap}" var="one">
              		<c:choose>
	   					<c:when test="${dataxEnterpriseChannelVO.id.fcServicecode==one.key}">
	   						<option value="<c:out value="${one.key}" />" selected="selected" ><c:out value="${one.value}" /></option>
	   					</c:when>
	   					<c:otherwise><option value="<c:out value="${one.key}" />"><c:out value="${one.value}" /></option></c:otherwise>
	   				</c:choose>
	            </c:forEach>
              </select>
              <input type="hidden" value="<c:out value="${dataxEnterpriseChannelVO.id.fcServicecode}" />" name="fcServicecode" id="fcServicecode"/>
			</td>
          </tr>
      </table>
    </div>
    
    
    <div class="notification querytj png_bg">
      <div>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:10px; border-bottom:1px dotted #CCC">
          <tr>
            <td width="11%" height="35" align="right"><strong>发送通道编号</strong>： </td>
            <td width="89%" height="35"><input type="text" name="fiSysSendId" id="fiSysSendId" value="<c:out value="${fiSysSendId}"/>" ></td>
          </tr>
        </table>
      
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:10px;border-bottom:2px solid #CCC">
          <tr>
            <td width="12%" height="35" align="right">&nbsp;&nbsp;发送传输方式：              </td>
            <td width="23%"><span id="fcCommunTypeSnd"><c:out value="${communTypeSnd}" /></span></td>
            <td width="11%"  align="right">发送物理地址：              </td>
            <td width="23%"><span id="fcCommunParamSnd"><c:out value="${communParamSnd}" /></span></td>
            <td width="11%" height="35"  align="right">报文格式：</td>
            <td width="20%"><span id="fcMsgFormateIdSnd"><c:out value="${msgFormateIdSnd}" /></span></td>
          </tr>
          <tr>
            <td height="35"  align="right">&nbsp;&nbsp;报文类型：</td>
            <td height="35"><span id="fcMsgTypeSnd"><c:out value="${msgTypeSnd}" /></span></td>
            <td height="35"  align="right">报文编码：</td>
            <td height="35"><span id="fcMsgCharsetSnd"><c:out value="${msgCharsetSnd}" /></span></td>
            <td height="35" colspan="2"> </td>         
          </tr>
        </table>
        
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:10px; border-bottom:1px dotted #CCC">
          <tr>
            <td width="11%" height="35" align="right"><strong>接收通道编号</strong>： </td>
            <td width="89%" height="35">
            <input type="type" name="fiSysReceiveId" id="fiSysReceiveId" value="<c:out value="${fiSysReceiveId}" />" >
            </td>
          </tr>
        </table>
      
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:10px">
          <tr>
            <td width="12%" height="35" align="right">&nbsp;&nbsp;接收传输方式：              </td>
            <td width="23%"><span id="fcCommunTypeRcv" name="communTypeRcv"><c:out value="${communTypeRcv}" /></span></td>
            <td width="11%"  align="right">接收物理地址：              </td>
            <td width="23%"><span id="fcCommunParamRcv" name="fcCommunParamRcv"><c:out value="${communParamRcv}" /></span></td>
            <td width="11%" height="35"  align="right">报文格式：</td>
            <td width="20%"><span id="fcMsgFormateIdRcv"><c:out value="${msgFormateIdRcv}" /></span></td>
          </tr>
          <tr>
            <td height="35"  align="right">&nbsp;&nbsp;报文类型：</td>
            <td height="35"><span id="fcMsgTypeRcv"><c:out value="${msgTypeRcv}" /></span></td>
            <td height="35"  align="right">报文编码：</td>
            <td height="35"><span id="fcMsgCharsetRcv"><c:out value="${msgCharsetRcv}" /></span></td>
            <td height="35" colspan="2"> </td>         
          </tr>
        </table>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:10px">
          <tr>
            <td height="35" colspan="4" align="right">状态：</td>
            <td width="91%" height="35" colspan="2">
            <c:forEach items="${optionFiFlagMap}" var="one">
	        	<input name="fiFlag" type="radio" style="border-width:0" value="<c:out value="${one.key}" />"  <c:out value="${dataxEnterpriseChannelVO.fiFlag==one.key?'Checked':''}"/>/><c:out value="${one.value}" />
	        </c:forEach>
	        </td>
          </tr>
          <tr>
            <td height="35" colspan="6" align="center"><div class="line"><a class="button" href="javascript:void(0);" onclick="editPassChannel();">保存</a> &nbsp;&nbsp;<a class="button" href="javascript:void(0)" onclick="history.go(-1)"> 取消</a></td>
          </tr>
        </table>
      </div>
    </div>
      
    </div>
    <div class="clear"></div>
  </div>
  <!-- End #main-content -->
</form:form>
</body>
</html>
